{"ast":null,"code":"import apiClient from \"../http\";\nimport { addMessage as addMessagePath, updateMessage as updateMessagePath, deleteMessages as deleteMessagesPath } from \"../routes\";\nexport default class MessageService {\n  static async addMessage(message) {\n    return apiClient.post(addMessagePath(), message);\n  }\n  static async updateMessage(message) {\n    return apiClient.put(updateMessagePath(), message);\n  }\n  static async deleteMessages(shortMessagesCollection) {\n    // @ts-ignore\n    return apiClient.delete(deleteMessagesPath(), shortMessagesCollection);\n  }\n}","map":{"version":3,"names":["apiClient","addMessage","addMessagePath","updateMessage","updateMessagePath","deleteMessages","deleteMessagesPath","MessageService","message","post","put","shortMessagesCollection","delete"],"sources":["/data/messenger.client/src/services/MessageService.ts"],"sourcesContent":["import apiClient from \"../http\";\nimport {AxiosResponse} from 'axios';\nimport {\n    addMessage as addMessagePath,\n    updateMessage as updateMessagePath,\n    deleteMessages as deleteMessagesPath\n} from \"../routes\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\nimport MessageRequest from \"../models/request/MessageRequest\";\nimport UpdateMessageItem from \"../models/request/UpdateMessageItem\";\nimport {MessagesShortListRequest} from \"../models/request/MessagesShortListRequest\";\n\nexport default class MessageService {\n    public static async addMessage(message: MessageRequest): Promise<AxiosResponse<ChatsListItem>> {\n        return apiClient.post<ChatsListItem>(addMessagePath(), message);\n    }\n\n    public static async updateMessage(message: UpdateMessageItem): Promise<AxiosResponse<ChatsListItem>> {\n        return apiClient.put<ChatsListItem>(updateMessagePath(), message);\n    }\n\n    public static async deleteMessages(shortMessagesCollection: MessagesShortListRequest): Promise<AxiosResponse<MessagesShortListRequest>> {\n        // @ts-ignore\n        return apiClient.delete<MessagesShortListRequest>(deleteMessagesPath(), shortMessagesCollection);\n    }\n}"],"mappings":"AAAA,OAAOA,SAAS,MAAM,SAAS;AAE/B,SACIC,UAAU,IAAIC,cAAc,EAC5BC,aAAa,IAAIC,iBAAiB,EAClCC,cAAc,IAAIC,kBAAkB,QACjC,WAAW;AAMlB,eAAe,MAAMC,cAAc,CAAC;EAChC,aAAoBN,UAAU,CAACO,OAAuB,EAAyC;IAC3F,OAAOR,SAAS,CAACS,IAAI,CAAgBP,cAAc,EAAE,EAAEM,OAAO,CAAC;EACnE;EAEA,aAAoBL,aAAa,CAACK,OAA0B,EAAyC;IACjG,OAAOR,SAAS,CAACU,GAAG,CAAgBN,iBAAiB,EAAE,EAAEI,OAAO,CAAC;EACrE;EAEA,aAAoBH,cAAc,CAACM,uBAAiD,EAAoD;IACpI;IACA,OAAOX,SAAS,CAACY,MAAM,CAA2BN,kBAAkB,EAAE,EAAEK,uBAAuB,CAAC;EACpG;AACJ"},"metadata":{},"sourceType":"module"}